/*
 * @Author: fangquan
 * @Date: 2020-06-10 13:38:32 
 * @Last Modified by: fangquan
 * @Last Modified time: 2020-06-10 13:38:32 
 * @Usage 工具类
 */

 @import "./variable.scss";

//  ---- 功能类 ----
.unselect {
  user-select: none;
}

.unevents {
  pointer-events: none;
}

.uncallout {
  -webkit-touch-callout: none;
}

// ---- 字体类 ----
.bold {
  font-weight: bolder;
}

.fine {
  font-weight: 300;
}

.fw1 {
  font-weight: 1;
}

.underline {
  text-decoration: underline;
}

.deleteline {
  text-decoration: line-through;
}

@for $i from 10 to 40 {
  .fz-#{$i} {
    font-size: $i * 1px;
  }
}

@for $i from 1 to 4 {
  .hide-text-#{$i} {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
    overflow: hidden;
  }
}

// ---- 显示类 ----
.radius {
  border-radius: $radius;
}

.circle {
  border-radius: 50%;
  @extend .hidden;
}

.border {
  border: 1px solid $color-border;
}

.border-bottom {
  border-bottom: 1px solid $color-border;

  &.border-bottom-bold {
    border-bottom-width: 5px;
  }
}

.shadow {
  box-shadow: 0 0 10px 2px rgba($color: $color-black, $alpha: 0.2);
}

.hidden {
  overflow: hidden;
}

.lh-2 {
  line-height: 2;
}

.lr {
  height: 100%;
  line-height: 60px;
  text-align: right;
}

.width {
  width: 100% !important;
}

.height {
  height: 100% !important;
}

// ---- 交互反馈 ----
.pointer {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    filter: brightness(0.8);
  }
}

// ---- 边距类 ----
@for $i from 1 to 8 {
  .mt-#{$i * 5} {
    margin-top: $i * 5 * 1px;
  }

  .mb-#{$i * 5} {
    margin-bottom: $i * 5 * 1px;
  }

  .ml-#{$i * 5} {
    margin-left: $i * 5 * 1px;
  }

  .mr-#{$i * 5} {
    margin-right: $i * 5 * 1px;
  }
  
  .ml1-#{$i * 1} {
    margin-left: $i * 1px;
  }

  .pt-#{$i * 5} {
    padding-top: $i * 5 * 1px;
  }

  .pb-#{$i * 5} {
    padding-bottom: $i * 5 * 1px;
  }

  .pl-#{$i * 5} {
    padding-left: $i * 5 * 1px;
  }

  .pr-#{$i * 5} {
    padding-right: $i * 5 * 1px;
  }

  .pd-#{$i * 5} {
    padding: $i * 5 * 1px;
  }
}

// ---- 定位类 ----
.relative {
  position: relative;
  z-index: 5;
}

.absolute {
  position: absolute;
}

// 粘性定位
.sticky {
  position: sticky;
  top: 0;
  top: var(--window-top);
  left: 0;
  z-index: 10;
}

// 全屏
.full-screen {
  position: fixed;
  top: 0;
  top: var(--window-top);
  left: 0;
  width: 100%;
  height: 100%;
  height: calc(100% - var(--window-top) - var(--window-bottom));
  z-index: 20;
}

// 绝对全屏
.full-screen-absolute {
  @extend .full-screen;
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 5;
}

// 头部
.header {
  position: fixed;
  top: 0;
  top: var(--window-top);
  left: 0;
  width: 100%;
  z-index: 10;
}

// 底部
.footer {
  position: fixed;
  bottom: 0;
  bottom: var(--window-bottom);
  left: 0;
  width: 100%;
  z-index: 10;
}

// 左下角
.fixed-bottom-right {
  position: fixed;
  right: 15px;
  bottom: 0;
  bottom: calc(var(--window-bottom) + 100px);
  z-index: 10;
}